<?php

use Illuminate\Database\Seeder;

class AdminSeede extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        factory (\App\Admin::class,5)->create ();
        $admin = \App\Admin::find(1);
        $admin->name='admin';
        $admin->nickname = '超级管理员';
        $admin->save();
		//手动添加一个站长的角色
		\Spatie\Permission\Models\Role::create([
			'name' => 'zhanzhang',
			'title' => '网站站长',
			'guard_name' => 'admin'
		]);
		//将默认的admin用户设置站长角色
		$admin->syncRoles('zhanzhang');
    }
}
